/* GUI CONVERTED from rewocla.p (converter v1.76) Wed May 22 11:22:57 2002 */
/* rewocla.p - CUMULATIVE ORDER ACCOUNTING CLOSE (SUBPROGRAM)                 */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.15 $                                                          */
/*V8:ConvertMode=Report                                                       */
/* REVISION: 7.4           CREATED: 01/11/95    by: srk *G0B8*                */
/* REVISION: 7.3      LAST MODIFIED: 02/07/95   BY: qzl *F0H9*                */
/* REVISION: 7.2      LAST MODIFIED: 03/04/95   BY: ais *F0LN*                */
/* REVISION: 8.5      LAST MODIFIED: 10/17/95   BY: sxb *J053*                */
/* REVISION: 7.2      LAST MODIFIED: 11/27/95   BY: emb *F0TL*                */
/* REVISION: 8.5      LAST MODIFIED: 01/30/96   BY: kxn *J0BY*                */
/* REVISION: 8.5      LAST MODIFIED: 03/13/96   BY: jym *G1GD*                */
/* REVISION: 8.5      LAST MODIFIED: 04/09/96   BY: jym *G1Q9*                */
/* REVISION: 8.5      LAST MODIFIED: 05/01/96   BY: jym *G1MN*                */
/* REVISION: 8.5      LAST MODIFIED: 07/26/96   BY: *J10X* Markus Barone      */
/* REVISION: 8.5      LAST MODIFIED: 07/09/96   BY: *G1Z3* Russ Witt          */
/* REVISION: 8.5      LAST MODIFIED: 12/18/96   BY: *G2JL* Russ Witt          */
/* REVISION: 8.5      LAST MODIFIED: 09/17/97   BY: *G2P5* Manmohan Pardesi   */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 10/01/99   BY: *N014* Murali Ayyagari    */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 09/05/00   BY: *N0RF* Mark Brown         */
/* REVISION: 9.1      LAST MODIFIED: 09/15/00   BY: *L12N* Jyoti Thatte       */
/* REVISION: 9.1      LAST MODIFIED: 10/10/00   BY: *N0H2* Vivek Gogte        */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.15 $    BY: Jean Miller          DATE: 05/21/02  ECO: *P05V*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdeclre.i}
{gplabel.i} /* EXTERNAL LABEL INCLUDE */

{gpglefv.i}

define new shared variable qty_comp like wr_qty_comp.
define new shared variable ref like glt_ref.
define new shared variable compop like op_wo_op.
define new shared variable complot like op_wo_lot.
define new shared variable transtype as character.
define new shared variable wo_recid as recid.
define new shared variable sf_entity like en_entity.
define new shared variable sf_cr_acct like glt_acct.
define new shared variable sf_dr_acct like glt_acct.
define new shared variable sf_cr_sub like glt_sub.
define new shared variable sf_dr_sub like glt_sub.
define new shared variable sf_cr_cc like glt_cc.
define new shared variable sf_dr_cc like glt_cc.
define new shared variable sf_cr_proj like glt_project.
define new shared variable sf_dr_proj like glt_project.
define new shared variable sf_gl_amt like tr_gl_amt.
define new shared variable glx_mthd like cs_method.
define new shared variable glx_set like cs_set.
define new shared variable cur_mthd like cs_method.
define new shared variable op_mtl_tot as decimal.
define new shared variable op_lbr_tot as decimal.
define new shared variable op_bdn_tot as decimal.
define new shared variable op_sub_tot as decimal.

define new shared variable cur_set like cs_set.
define new shared variable op_mtl as decimal.
define new shared variable op_lbr as decimal.
define new shared variable op_bdn as decimal.
define new shared variable op_sub as decimal.
define new shared variable tr_recno as recid.
define new shared variable trgltype as character.
define new shared variable comment like op_comment.

define shared variable gldetail like mfc_logical no-undo.
define shared variable gltrans like mfc_logical no-undo.
define shared variable nbr like wo_nbr label "Cumulative Order".
define shared variable nbr1 like wo_nbr.
define shared variable lot like wo_lot.
define shared variable lot1 like wo_lot.
define shared variable part like wo_part.
define shared variable part1 like wo_part.
define shared variable site like wo_site.
define shared variable site1 like wo_site.
define shared variable project like wo_project.
define shared variable project1 like wo_project.
define shared variable salesjob like wo_so_job.
define shared variable salesjob1 like wo_so_job.
define shared variable eff_date like glt_effdate initial today.

define variable sf_transtype as character no-undo.
define variable routing like wo_routing.
define variable desc1 like pt_desc1 format "x(49)".

define variable gldesc like ac_desc no-undo.
define variable gldesc1 like ac_desc no-undo.
define variable i as integer.
define variable msg_counter as integer no-undo.
define variable undo_tran like mfc_logical no-undo.
define variable mesg_desc as character no-undo.

define variable prev_mthd like cs_method.
define variable qty_reqd like wr_qty_comp.
define variable item_yield as decimal no-undo.
define variable bomqty like wod_bom_qty.
define variable bombatch like bom_batch.
define variable prev_post like sf_gl_amt.
define variable iss_yn like mfc_logical.
define variable msg-arg1 as character format "x(16)" no-undo.
define variable msg-arg2 as character format "x(16)" no-undo.
define variable msg-desc like msg_desc no-undo.

define new shared frame d.

define buffer womstr1 for wo_mstr.

define new shared workfile audit_gl
   field audit_acct like glt_acct
   field audit_sub like glt_sub
   field audit_cc like glt_cc
   field audit_project like glt_project
   field audit_amt like glt_amt.

/* FORM DEFINITION FOR FRAME D */
{wowocl.i}

/* ADD THE FOLLOWING FORM STATEMENT TO REPORT RECORES WITH */
/* SITES WHICH HAVE CLOSED GL PERIOD FOR THAT ENTITY       */
FORM /*GUI*/ 
   wo_lot
   wo_site
   msg-desc format "x(40)"
   si_entity
with STREAM-IO /*GUI*/  frame entity-closed width 132 no-attr-space down.

/* SET EXTERNAL LABELS */
setFrameLabels(frame entity-closed:handle).

FORM /*GUI*/ 
   space(10)
with STREAM-IO /*GUI*/  frame bframe width 132 page-top no-box.

find gl_ctrl no-lock.
find mfc_ctrl where mfc_field = "rpc_using_new" no-lock no-error.

if available mfc_ctrl and mfc_logical = true then do:
   /* Use of this function not allowed, new repetitive enabled */
   {pxmsg.i &MSGNUM=5122 &ERRORLEVEL=3}
   message.
   message.
   undo, leave.
end.

for each audit_gl exclusive-lock:
   delete audit_gl.
end.

view frame bframe.

/* CLOSE EACH WORK ORDER IN RANGE */
wo-loop:

for each wo_mstr no-lock where
         wo_type = "C"
    and (wo_wip_tot <> 0 or wo_status <> "C" or not wo_acct_close)
    and (wo_nbr >= nbr and wo_nbr <= nbr1)
    and (wo_lot >= lot and wo_lot <= lot1)
    and (wo_part >= part and wo_part <= part1)
    and (wo_site >= site and wo_site <= site1)
    and (wo_project >= project and wo_project <= project1)
    and (wo_so_job >= salesjob and wo_so_job <= salesjob1),
    each si_mstr no-lock where si_site = wo_site
with frame b width 132 down no-attr-space:

   /* READ THE MARKER RECORD THAT MAY EXIST IF USERS ARE REPORTING  */
   /* LABOR AGAINST THE CURRENT WO. THE WO WILL NOT BE CLOSED UNTIL */
   /* THE MARKER RECORD DOES NOT EXIST.                             */
   msg_counter = 0.
   mesg_desc = wo_nbr + ',' + wo_lot.

   wait-loop:
   repeat:

      undo_tran = yes.

      find first qad_wkfl where qad_key3 = "labor_tran"
                            and qad_key4 begins wo_lot
      no-lock no-error.

      if available qad_wkfl then do:
         if msg_counter modulo 100 = 0 then do:
            /* UNABLE TO CLOSE WORK ORDER NUMBER, ID */
            {pxmsg.i &MSGNUM=2016 &ERRORLEVEL=1 &MSGARG1=mesg_desc}
            /* WORK ORDER RECORD IS LOCKED BY USER #. # TO EXIT */
            msg-arg1 = kblabel("end-error").
            msg-arg2 = fill(".",(msg_counter / 100) mod 20).
            {pxmsg.i &MSGNUM=2014 &ERRORLEVEL=1
                     &MSGARG1=qad_key6
                     &MSGARG2=msg-arg1
                     &MSGARG3=msg-arg2}
            readkey pause 1.
            if keyfunction(lastkey) = "end-error" then
               leave wait-loop.
            apply lastkey.
         end.
         msg_counter = msg_counter + 1.
         next wait-loop.
      end. /* IF AVAILABLE QAD_WKFL */

      else do:
         undo_tran = no.
         leave wait-loop.
      end. /* IF NOT AVAILABLE QAD_WKFL */

   end. /* WAIT-LOOP */

   hide message no-pause.

   if undo_tran then undo wo-loop, leave wo-loop.

   find womstr1 exclusive-lock where
      recid(womstr1) = recid(wo_mstr) no-error.

   /* VALIDATE OPEN GL PERIOD FOR SPECIFIED ENTITY */
   assign
      gpglef_entity = si_entity
      gpglef_effdate = eff_date
      gpglef_tr_type = "WO".

   {gprun.i ""gpglef1.p""
      "(input gpglef_tr_type,
        input gpglef_entity,
        input gpglef_effdate,
        output gpglef_result,
        output gpglef_msg_nbr)"}

   if gpglef_msg_nbr > 0 then do:
      /* INVALID PERIOD */
      if gpglef_result = 1 then do:
         {pxmsg.i &MSGNUM=3016 &ERRORLEVEL=1 &MSGBUFFER=msg-desc}
      end.

      /* PERIOD CLOSED FOR ENTITY */
      else do:
         {pxmsg.i &MSGNUM=3036 &ERRORLEVEL=1 &MSGBUFFER=msg-desc}
      end.

      display
         womstr1.wo_lot
         womstr1.wo_site
         msg-desc
         si_entity
      with frame entity-closed STREAM-IO /*GUI*/ .

      down 1 with frame entity-closed.
      next wo-loop.

   end. /* INVALID ENTITY */

   if womstr1.wo_wip_tot = 0 and
      womstr1.wo_acct_close
      then next.

   if womstr1.wo_type = "F" then do:

      do i = length(womstr1.wo_nbr) to 1 by -1:
         if substring(womstr1.wo_nbr,i,1) = "." then leave.
      end.

      if i = 0 then
      find sod_det no-lock where
           sod_nbr = womstr1.wo_nbr and sod_line = 0 no-error.

      else
      find sod_det no-lock where
           sod_nbr = substring(womstr1.wo_nbr,1,i - 1)
       and sod_line = integer(substring(womstr1.wo_nbr,i + 1))
      no-error.

   end.

   if available sod_det then next.

   assign
      womstr1.wo_acct_close = yes
      womstr1.wo_close_date = today
      womstr1.wo_close_eff  = eff_date.

   {gprun.i ""wowoclf.p""
      "(input recid(womstr1),
        input eff_date,
        output tr_recno)"}

   assign
      sf_entity = si_entity
      wo_recid = recid(womstr1).

   /*DETERMINE COSTING METHOD*/
   {gprun.i ""csavg01.p""
      "(input womstr1.wo_part,
        input womstr1.wo_site,
        output glx_set,
        output glx_mthd,
        output cur_set,
        output cur_mthd)"}

   assign
      op_mtl = 0
      op_lbr = 0
      op_bdn = 0
      op_sub = 0
      desc1 = "".

   find pt_mstr where pt_part = womstr1.wo_part no-lock no-error.
   if available pt_mstr then do:
      desc1 = pt_desc1 + " " + pt_desc2.
      find pl_mstr where pl_prod_line = pt_prod_line no-lock.
   end.

   /*PRINT WO ACCT CLOSE REPORT #1 HEADER*/
   if page-size - line-counter < 9 then page.
   do with frame b:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame b:handle).

      display
         womstr1.wo_nbr
         womstr1.wo_lot
         womstr1.wo_part
         womstr1.wo_site
         womstr1.wo_qty_ord
         womstr1.wo_qty_comp
         womstr1.wo_qty_rjct
         womstr1.wo_so_job
         womstr1.wo_project
         eff_date WITH STREAM-IO /*GUI*/ .

      if desc1 <> "" then do:
         put desc1 at 19.
         down 1.
      end.
      else down 2.

   end.

   routing = womstr1.wo_routing.
   if routing = "" then routing = womstr1.wo_part.
   qty_comp = womstr1.wo_qty_comp.

   /*CLOSE WORK ORDER OPERATIONS*/
   if glx_mthd <> "AVG" then do:
      find last wr_route where wr_nbr = womstr1.wo_nbr
                           and wr_lot = womstr1.wo_lot
      no-error.
      if available wr_route then do:
         compop = wr_op.
         complot = wr_lot.
         transtype = "WO-CLOSE".
         {gprun.i ""sfopclse.p""}
      end.
   end.

   qty_comp = womstr1.wo_qty_comp + womstr1.wo_qty_rjct.
   qty_reqd = qty_comp.

   /*USED FOR LAST COST ONLY*/
   assign
      op_lbr_tot = 0
      op_bdn_tot = 0
      op_sub_tot = 0.

   for each wr_route where wr_nbr = womstr1.wo_nbr
                       and wr_lot = womstr1.wo_lot
   by wr_op descending:

      if glx_mthd <> "AVG" then do:

         /*CALCULATE SUBCONTRACT STANDARD USAGE*/
         find ro_det where ro_routing = routing
                       and ro_op = wr_op
                       and (ro_start = ? or ro_start <= today)
                       and (ro_end = ? or ro_end >= today)
         no-lock no-error.

         if available ro_det then do:

            /* REPLACED ro_sub_cost WITH wr_sub_cost AS THE */
            /* LATTER BEING FREEZED COST WOULD BE USED TO   */
            /* TO CALCULATE SUBCONTRACT USAGE VARIANCE      */
            if wr_sub_cost <> 0
            then do:
               wr_sub_std = qty_reqd * wr_sub_cost.
               /* ROUND GL AMOUNT TO BASE CURRENCY PRECISION */
               {gprun.i ""gpcurrnd.p"" "(input-output wr_sub_std,
                    input gl_rnd_mthd)"}
               wr_svuse_accr = 1.   /*FORCE WOVARUP TO POST*/
            end. /* IF WR_SUB_COST <> 0 */
            qty_reqd = qty_reqd / (ro_yield_pct * .01).
         end.

         /*POST UNPOSTED (ACCRUED) LBR, BDN, AND SUB VARIANCES*/
         transtype = "WO-CLOSE".
         {gprun.i ""wovarup.p""}

      end.

      assign
         op_lbr = op_lbr + wr_lbr_act - wr_lbr_totx
         op_bdn = op_bdn + wr_bdn_act - wr_bdn_totx
         op_sub = op_sub + wr_sub_act - wr_sub_totx
         wr_lbr_totx = wr_lbr_act
         wr_bdn_totx = wr_bdn_act
         wr_sub_totx = wr_sub_act
         wr_status   = "C"
         wr_qty_wip  = 0.

      /*USED FOR LAST COST ONLY*/
      assign
         op_lbr_tot = op_lbr_tot + wr_lbr_act
         op_bdn_tot = op_bdn_tot + wr_bdn_act
         op_sub_tot = op_sub_tot + wr_sub_act.

   end.  /*for each wr_route*/

   for each wod_det where wod_lot = womstr1.wo_lot:

      find qad_wkfl where qad_key1 = "MFWORLA"
                      and qad_key2 = wod_lot + wod_part + string(wod_op)
      exclusive-lock no-error.

      if not available qad_wkfl then do:
         create qad_wkfl.
         assign
            qad_key1 = "MFWORLA"
            qad_key2 = wod_lot + wod_part + string(wod_op).
         qad_decfld[1] = wod_bom_qty.
         qad_decfld[2] = 1.
         qad_decfld[3] = 0.
         recno = recid(qad_wkfl).
      end.

      if qad_decfld[2] = 0 or qad_decfld[2] = ? then
         qad_decfld[2] = 1.

      /* Data corruption caused by ECO F0G3 */
      if qad_decfld[1] = ? then do:
         qad_decfld[1] = 0.
         if wod_bom_qty <> ? then
            qad_decfld[1] = wod_bom_qty * qad_decfld[2].
      end.

      assign
         bomqty    = qad_decfld[1]
         bombatch  = qad_decfld[2]
         prev_post = qad_decfld[3].

      if bombatch = 0 then
         bombatch = 1.

      assign
         sf_gl_amt = 0
         iss_yn = yes.

      /*ITEM YIELD CALCULATION MOVED FROM SPOT MARKED BELOW*/
      /*DETERMINE LOSS DUE TO YIELD OF COMPONENT ITEMS*/
      /*(LOSS FOR LABOR ETC IS CALCULATED IN ROUTING ROLL-UP)*/
      item_yield = 100.

      for each wr_route no-lock
         where wr_lot = wod_lot
           and wr_op >= wod_op:
         item_yield = item_yield * wr_yield_pct * .01.
      end.

      if item_yield = 0 then
         item_yield = 100.

      /*POST FLOOR STOCK TO WIP*/
      /*NOTE: POSTING IS IN ADDITION TO ANY SPECIFIC ISSUES */
      find pt_mstr where pt_part = wod_part no-lock no-error.

      if available pt_mstr then do:

         find ptp_det where ptp_part = pt_part
                        and ptp_site = womstr1.wo_site
         no-lock no-error.

         if (available ptp_det and ptp_iss_pol = no)
         or (not available ptp_det and pt_iss_pol = no)
         then do:
            /******************************************************/
            /*  USE THE FOLLOWING CODE TO REPLACE SPECIFIC ISSUES */
            /*  WITH STANDARD COST RATHER THAN ADD TO THEM        */
            /*    wod_qty_iss = qty_comp * wod_bom_qty.           */
            /*    sf_gl_amt = (wod_qty_iss * wod_bom_amt)         */
            /*    - (wod_tot_std - wod_mvrte_post).               */
            /*    wod_tot_std = wod_qty_iss * wod_bom_amt.        */
            /******************************************************/

            sf_gl_amt = (((bomqty * qty_comp) / bombatch) /
                          (item_yield * .01) * wod_bom_amt) -
                        prev_post.

            /* ROUND GL AMOUNT TO BASE CURRENCY PRECISION */
            {gprun.i ""gpcurrnd.p"" "(input-output sf_gl_amt,
                 input gl_rnd_mthd)"}

            if sf_gl_amt <> 0 then do:

               assign
                  qad_decfld[3] = qad_decfld[3] + sf_gl_amt
                  wod_tot_std = wod_tot_std + sf_gl_amt
                  womstr1.wo_mtl_tot = womstr1.wo_mtl_tot + sf_gl_amt
                  womstr1.wo_wip_tot = womstr1.wo_wip_tot + sf_gl_amt
                  sf_dr_acct = womstr1.wo_acct
                  sf_dr_sub = womstr1.wo_sub
                  sf_dr_cc = womstr1.wo_cc
                  sf_dr_proj = womstr1.wo_project
                  sf_cr_acct = womstr1.wo_flr_acct
                  sf_cr_sub = womstr1.wo_flr_sub
                  sf_cr_cc = womstr1.wo_flr_cc
                  sf_cr_proj = ""
                  transtype = "WO-CLOSE"
                  trgltype = "FLR-STK".

               /* POST TO G/L ACCOUNT */
               {gprun.i ""wowoclb.p""}

               sf_transtype = "".

               {gprun.i ""wowoclj.p""
                  "(input sf_cr_acct,
                    input sf_dr_acct,
                    input sf_cr_sub,
                    input sf_dr_sub,
                    input sf_cr_cc,
                    input sf_dr_cc,
                    input sf_cr_proj,
                    input sf_dr_proj,
                    input sf_gl_amt,
                    input sf_transtype,
                    input gltrans,
                    input gldetail)"}

            end. /*if sf_gl_amt <> 0*/

            sf_gl_amt = 0.
            iss_yn = no.

         end. /*no-pick items*/

      end. /*if available pt_mstr*/

      if glx_mthd <> "AVG" then do:

         /*ITEM YIELD WAS ORIGINALLY CALCULATED HERE*/
         /*POST MATERIAL USAGE VARIANCE*/
         if iss_yn then
            sf_gl_amt = (((wod_qty_iss -
                        (((bomqty * qty_comp) / bombatch) /
                         (item_yield * .01))) * wod_bom_amt) -
                         wod_mvuse_rval) - wod_mvuse_post.

         /* ROUND GL AMOUNT TO BASE CURRENCY PRECISION */
         {gprun.i ""gpcurrnd.p"" "(input-output sf_gl_amt,
              input gl_rnd_mthd)"}

         if sf_gl_amt <> 0 then do:

            assign
               wod_mvuse_post = wod_mvuse_post + sf_gl_amt
               wod_mvuse_accr = wod_mvuse_accr + sf_gl_amt
               womstr1.wo_mtl_tot = womstr1.wo_mtl_tot - sf_gl_amt
               womstr1.wo_wip_tot = womstr1.wo_wip_tot - sf_gl_amt
               womstr1.wo_mtl_var = womstr1.wo_mtl_var + sf_gl_amt
               sf_dr_acct = womstr1.wo_mvar_acct
               sf_dr_sub = womstr1.wo_mvar_sub
               sf_dr_cc = womstr1.wo_mvar_cc
               sf_dr_proj = ""
               sf_cr_acct = womstr1.wo_acct
               sf_cr_sub = womstr1.wo_sub
               sf_cr_cc = womstr1.wo_cc
               sf_cr_proj = womstr1.wo_project
               transtype = "WO-CLOSE"
               trgltype = "MATL-VAR".

            /* POST TO G/L ACCOUNT */
            {gprun.i ""wowoclb.p""}

            sf_transtype = "".

            {gprun.i ""wowoclj.p""
               "(input sf_cr_acct,
                 input sf_dr_acct,
                 input sf_cr_sub,
                 input sf_dr_sub,
                 input sf_cr_cc,
                 input sf_dr_cc,
                 input sf_cr_proj,
                 input sf_dr_proj,
                 input sf_gl_amt,
                 input sf_transtype,
                 input gltrans,
                 input gldetail)"}

         end. /*if sf_gl_amt <> 0*/

      end. /*if glx_mthd <> "AVG"*/

      /* COMBINED THE ASSIGN STATEMENTS op_mtl = op_mtl + . . */
      assign
         op_mtl_tot   = op_mtl_tot + wod_tot_std
         op_mtl       = op_mtl + wod_tot_std - wod_mtl_totx
         wod_mtl_totx = wod_tot_std.

   end. /*for each wod_det*/

   /*UPDATE CURRENT COST*/
   /*REPLACED PREVIOUS CALCULATION LOGIC IN ITS ENTIRETY*/
   if (cur_mthd = "AVG" or cur_mthd = "LAST") then do:
      {gprun.i ""wowoclc.p""}
   end.

   /*METHOD CHANGE VARIANCE AND REPORTS*/

   /*UPDATE AVERAGE GL COST AND/OR POST INVENTORY DISCREPANCY*/
   /*ELSE POST METHOD CHANGE VARIANCE*/
   /*REPLACED PREVIOUS LOGIC IN ITS ENTIRETY*/
   if glx_mthd = "AVG" then do:
      {gprun.i ""wowocld.p""}
   end.
   else do:
      {gprun.i ""wowocle.p""}
   end.

   womstr1.wo_status = "C".
   womstr1.wo_wip_tot = 0.

end. /* for each wo_mstr */

/*PRINT ACCT CLOSE REPORT #2 (GL DETAIL REPORT)*/
{gprun.i ""wowoclg.p""}
